package com.indusfo.spc.mapper;

import com.indusfo.spc.pojo.MaintainWork;
import com.indusfo.spc.pojo.MaintainWorkDetail;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface MaintainWorkDetailMapper {


    /**
     * 批量新增设备保养作业明细
     * @param maintainWorkId
     * @param maintainIds
     * @return
     */
    int updateMaintainWorkDetailList(@Param("maintainWorkId") Integer maintainWorkId,@Param("maintainIds") Integer[] maintainIds);

    /**
     * 查询设备保养作业明细
     * @param maintainWorkDetail
     * @return
     */
    List<MaintainWorkDetail> queryMaintainWorkDetail(MaintainWorkDetail maintainWorkDetail);



    /**
     * 计数
     * @param maintainWorkDetail
     * @return
     */
    int countMaintainWorkDetail(MaintainWorkDetail maintainWorkDetail);


    /**
     * 删除设备保养作业明细
     * @param maintainWorkId
     * @param maintainIds
     * @return
     */
    int defineMaintainPlanDetail(@Param("maintainWorkId") Integer maintainWorkId,@Param("maintainIds") Integer[] maintainIds,@Param("dataState") Integer dataState);

    /**
     * 获取指定作业下的明细的保养项目id
     * @param maintainWork
     * @return
     */
    List<Integer> queryMaintainIdList(MaintainWork maintainWork);

    int defineByMaintainWorkId(@Param("maintainWorkIds") Integer[] maintainWorkIds,@Param("dataState") Integer dataState);
    // 根据保养ID查询
    int selectByMaintainId(@Param("maintainIds")Long[] maintainIds);


    /**
     * 批量新增设备保养作业明细
     * @param maintainWorkDetailList
     * @return
     */
    int insertMatinWorkDetailList(@Param("maintainWorkDetailList") List<MaintainWorkDetail> maintainWorkDetailList);
    /**
     * 批量更新设备保养作业明细
     * @param maintainWorkDetailList
     * @return
     */
    int updateMatinWorkDetailList(@Param("maintainWorkDetailList") List<MaintainWorkDetail> maintainWorkDetailList);
    /**
     * 批量删除设备保养作业明细
     * @param maintainWorkDetailList
     * @return
     */
    int defineMatinWorkDetailList(@Param("maintainWorkDetailList") List<MaintainWorkDetail> maintainWorkDetailList,@Param("dataState") Integer dataState);
}